<?php
$loader->requireOnce('includes/CorePayment/BillMaker.abstract.php');
$loader->requireOnce('includes/CorePayment/OutPatientBillMaker/OutBedImporter.class.php');
$loader->requireOnce('includes/CorePayment/OutPatientBillMaker/OutMaterialImporter.class.php');
$loader->requireOnce('includes/CorePayment/OutPatientBillMaker/OutMedicineImporter.class.php');
$loader->requireOnce('includes/CorePayment/OutPatientBillMaker/OutParacliniqueImporter.class.php');
$loader->requireOnce('includes/CorePayment/OutPatientBillMaker/OutServiceImporter.class.php');
$loader->requireOnce('includes/PaymentException.class.php');
class OutPatientBillMaker extends BillMaker {
    public function create($type) {
    	switch ($type) {
    		case PaymentConstant::ITEM_BED:
                return new OutBedImporter($this->storage);
                break;
    		case PaymentConstant::ITEM_MATERIAL:
                return new OutMaterialImporter($this->storage);
            case PaymentConstant::ITEM_MEDICINE:
                return new OutMedicineImporter($this->storage);
            case PaymentConstant::ITEM_PARACLINIQUE:
                return new OutParacliniqueImporter($this->storage);
            case PaymentConstant::ITEM_SERVICE:
                return new OutServiceImporter($this->storage);
    		default:
    			throw new PaymentException("Billable item type '$type' is not supported",
                   PaymentErrorCode::BILLABLE_ITEM_TYPE_NOT_SUPPORTED);
    	}
    }
}
?>